﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="DataStore"
                   namespace="DataStore.Domain">
  <class name="Person" table="Person" discriminator-value="Person">
    <id name="Id" column="PersonId" type="Guid">
      <generator class="guid" />
    </id>
    <property name="FirstName" type="String" />
    <property name="MiddleName" type="String" />
    <property name="LastName" type="String" />
    <property name="Comment" type="String" />
    <property name="Position" type="String" />
    <property name="Title" type="String" />
    <!--<bag name="Institutions" table="person_company" lazy="true" cascade="save-update">
      <key column="PersonId" />
      <many-to-many class="Company" column="CompanyId" />
    </bag>
    <many-to-one name="Emails" column="Owner" class="EmailLink" />
    <many-to-one name="Websites" column="Owner" class="WebPageLink" />
    <many-to-one name="Images" column="Owner" class="ImageLink" />
    <set name="PhoneNumbers" lazy="true" table="PersonPhone">
      <key column="PersonId" />
      <element type="String" column="PhoneNumber" not-null="true" />
    </set>
    <many-to-one name="Addresses" column="Owner" class="Address" />-->

    <joined-subclass name="Author" table="Author">
      <key column="AuthorId" />
    </joined-subclass>

    <joined-subclass name="Editor" table="Editor">
      <key column="AuthorId" />
    </joined-subclass>
  </class>
  
</hibernate-mapping>